import request from '../../request'

// 获取table数据
export function getOrganization(params) {
    return request({
        url: 'BdOrganization/getOrganization',
        method: 'POST',
        data: params
    })
}

// 获取规则
export function getRule(params) {
    return request({
        url: 'bdEnumdetail/getRule',
        method: 'POST',
        data: params
    })
}

// 获取部门列表
export function getDeptNameList(params) {
    return request({
        url: 'bdDepartment/getDeptNameList',
        method: 'POST',
        data: params
    })
}

// 获取科室列表
export function getParentCodeList(params) {
    return request({
        url: 'bdDepartment/getParentCodeList',
        method: 'POST',
        data: params
    })
}

// 部门模糊查询
export function getDeptName(params) {
    return request({
        url: 'bdDepartment/getDeptName',
        method: 'GET',
        params
    })
}

// 科室模糊查询
export function getCostDepartments(params) {
    return request({
        url: 'bdDepartment/getCostDepartments',
        method: 'POST',
        data: params
    })
}

// 添加科室部门对应规则
export function insertRule(params) {
    return request({
        url: 'bdEnumdetail/insertRule',
        method: 'POST',
        data: params
    })
}

// 编辑核算单元
export function modifyOrganization(params) {
    return request({
        url: 'BdOrganization/modifyOrganization',
        method: 'POST',
        data: params
    })
}

// 新增科室部门对应
export function saveOrganization(params) {
    return request({
        url: 'BdOrganization/saveOrganization',
        method: 'POST',
        data: params
    })
}

// 设置规则为默认
export function setDefault(params) {
    return request({
        url: 'bdEnumdetail/setDefault',
        method: 'POST',
        data: params
    })
}

// 获取科室部门对应
export function getOrganizationSource(params) {
    return request({
        url: 'BdOrganization/getOrganizationSource',
        method: 'POST',
        data: params
    })
}

// 添加科室规则
export function addEnumDetail(params) {
    return request({
        url: 'bdEnumdetail/addEnumDetail',
        method: 'POST',
        data: params
    })
}

// 添加科室部门对应数据
export function addOrganization(params) {
    return request({
        url: 'BdOrganization/addOrganization',
        method: 'POST',
        data: params
    })
}

// 添加科室部门对应数据
export function getNoRelationDepartmentList(params) {
    return request({
        url: 'BdOrganization/getNoRelationDepartmentList',
        method: 'POST',
        data: params
    })
}

// 获取详情
export function getOrganizationNormal(params) {
    return request({
        url: 'BdOrganization/getOrganizationNormal',
        method: 'POST',
        data: params
    })
}

// 删除
export function batchDeleteOrganization(params) {
    return request({
        url: 'BdOrganization/batchDeleteOrganization',
        method: 'POST',
        data: params
    })
}
// 继承
export function addInheritanceRules(params) {
    return request({
        url: 'BdOrganization/addInheritanceRules',
        method: 'POST',
        data: params
    })
}

//科室-导出
export function downloadTemplate(params) {
    return request({
        url: 'BdOrganization/downloadTemplate',
        method: 'POST',
        data: params,
        responseType: 'blob'
    })
}
//科室-规则删除
export function deleteRule(params) {
    return request({
        url: 'BdOrganization/deleteRule',
        method: 'get',
        params
    })
}
